home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Agent Central Host Computer
/
Agent - Central Host Computer.iso
/
_SETUP.1
/
vjamssummary.sql
< prev
next >
Wrap
Text File
|
2000-05-12
|
2KB
|
40 lines
CREATE OR REPLACE VIEW VJAMSSUMMARY AS
SELECT DISTINCT ALARMACT.DET_SEQ_NUM , OPERATOR_CONTEXT.FAREBOX_GLID, CONV_DATE,
OPERATOR_CONTEXT.USER_ID,
DRIVER_CONTEXT.ROUTE_ID, DRIVER_CONTEXT.RUN_ID, DRIVER_CONTEXT.TRIP_ID,
ALARMACT.alarm_id alarm,
0 curr_type, '01' table_code, BUS.bus_id
FROM ALARMACT, MSTRREC, OPERATOR_CONTEXT, DRIVER_CONTEXT , BUS, FAREBOX
WHERE TRUNC(conv_date) > '01-JAN-2000' AND ALARMACT.alarm_id
IN (22, 23, 24, 25, 26, 34 ) AND
ALARMACT.det_seq_num = MSTRREC.det_seq_num AND
MSTRREC.OPERATOR_CONTEXT = OPERATOR_CONTEXT.op_context_id AND
MSTRREC.DRIVER_CONTEXT = DRIVER_CONTEXT.DRIVER_CONTEXT_ID AND
/*DRIVER_CONTEXT.op_context_id = OPERATOR_CONTEXT.op_context_id AND*/
BUS.glid = FAREBOX.location AND
FAREBOX.glid = OPERATOR_CONTEXT.farebox_glid
UNION
SELECT CMDINIT.DET_SEQ_NUM, OPERATOR_CONTEXT.FAREBOX_GLID, CONV_DATE,
OPERATOR_CONTEXT.USER_ID,
DRIVER_CONTEXT.ROUTE_ID, DRIVER_CONTEXT.RUN_ID, DRIVER_CONTEXT.TRIP_ID,
CMDINIT.command_id alarm, 0 curr_type,'12' table_code, BUS.bus_id
FROM CMDINIT, MSTRREC, OPERATOR_CONTEXT, DRIVER_CONTEXT , BUS, FAREBOX
WHERE TRUNC(conv_date) > '01-JAN-2000' AND CMDINIT.command_id IN (7, 8, 9, 10) AND
CMDINIT.det_seq_num = MSTRREC.det_seq_num AND
MSTRREC.OPERATOR_CONTEXT = OPERATOR_CONTEXT.op_context_id AND
MSTRREC.DRIVER_CONTEXT = DRIVER_CONTEXT.DRIVER_CONTEXT_ID AND
BUS.glid = FAREBOX.location AND
FAREBOX.glid = OPERATOR_CONTEXT.farebox_glid
UNION
SELECT CURACC.DET_SEQ_NUM, OPERATOR_CONTEXT.FAREBOX_GLID, CONV_DATE,
OPERATOR_CONTEXT.USER_ID,
DRIVER_CONTEXT.ROUTE_ID, DRIVER_CONTEXT.RUN_ID, DRIVER_CONTEXT.TRIP_ID,
0 alarm, FLOOR(0.01 * currency_type) curr_type, '16' table_code, BUS.bus_id
FROM CURACC, MSTRREC, OPERATOR_CONTEXT, DRIVER_CONTEXT, BUS, FAREBOX
WHERE TRUNC(conv_date) > '01-JAN-2000' AND CURACC.det_seq_num = MSTRREC.det_seq_num AND
MSTRREC.OPERATOR_CONTEXT = OPERATOR_CONTEXT.op_context_id AND
MSTRREC.DRIVER_CONTEXT = DRIVER_CONTEXT.DRIVER_CONTEXT_ID AND
BUS.glid = FAREBOX.location AND
FAREBOX.glid = OPERATOR_CONTEXT.farebox_glid